set(CPACK_PACKAGE_NAME "@PROJECT_NAME@")
set(CPACK_RPM_PACKAGE_NAME "@PROJECT_NAME@")
set(CPACK_PACKAGE_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@")
set(CPACK_PACKAGE_VERSION_MINOR "@PROJECT_VERSION_MINOR@")
set(CPACK_PACKAGE_VERSION_PATCH "@PROJECT_VERSION_REVISION@")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "@PROJECT_DESCRIPTION@")
set(CPACK_PACKAGE_VENDOR "@PROJECT_VENDOR@")

if(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
   set(CPACK_PACKAGE_FILE_NAME "@PROJECT_NAME_LOWER@_@PROJECT_VERSION@_@CPACK_DEBIAN_PACKAGE_ARCHITECTURE@")		 
endif(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
if(CPACK_RPM_PACKAGE_ARCHITECTURE)
   set(CPACK_PACKAGE_FILE_NAME "@PROJECT_NAME@-@PROJECT_VERSION@-@CPACK_RPM_PACKAGE_ARCHITECTURE@")
endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
set(CPACK_RESOURCE_FILE_LICENSE "@PROJECT_SOURCE_DIR@/COPYING.LESSER")

set(CPACK_COMPONENTS_ALL component)
set(CPACK_COMPONENT_COMPONENT_DISPLAY_NAME "Applications")
set(CPACK_COMPONENT_COMPONENT_DESCRIPTION
    "Component library and stand-alone executable")
if(INSTALL_HEADERS)
    set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL}  headers)
    set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Header files")
    set(CPACK_COMPONENT_HEADERS_DESCRIPTION
        "Header files from the component.")
    set(CPACK_COMPONENT_HEADERS_DEPENDS component)
endif(INSTALL_HEADERS)
if(INSTALL_IDL)
    set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} idl)
    set(CPACK_COMPONENT_IDL_DISPLAY_NAME "IDL files")
    set(CPACK_COMPONENT_IDL_DESCRIPTION
        "IDL files for the component's services.")
    set(CPACK_COMPONENT_IDL_DEPENDS component)
endif(INSTALL_IDL)
set(INSTALL_EXAMPLES @BUILD_EXAMPLES@)
if(INSTALL_EXAMPLES)
    set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} examples)
    set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
    set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION
        "Sample configuration files and other component resources.")
    set(CPACK_COMPONENT_EXAMPLES_DEPENDS component)
endif(INSTALL_EXAMPLES)
set(INSTALL_DOCUMENTATION @BUILD_DOCUMENTATION@)
if(INSTALL_DOCUMENTATION)
    set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} documentation)
    set(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation")
    set(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION
        "Component documentation")
    set(CPACK_COMPONENT_DOCUMENTATION_DEPENDS component)
endif(INSTALL_DOCUMENTATION)
if(INSTALL_SOURCES)
    set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} sources)
    set(CPACK_COMPONENT_SOURCES_DISPLAY_NAME "Source files")
    set(CPACK_COMPONENT_SOURCES_DESCRIPTION
        "Source files from the component.")
endif(INSTALL_SOURCES)

IF (WIN32)
    set(CPACK_GENERATOR "WIX")
    set(CPACK_RESOURCE_FILE_LICENSE
        "@CMAKE_CURRENT_SOURCE_DIR@/cmake/License.rtf")
    set(CPACK_PACKAGE_FILE_NAME
        "@PROJECT_NAME@@PROJECT_SHORT_VER@_rtm@RTM_SHORT_VER@_${CPACK_SYSTEM_NAME}")
    set(CPACK_PACKAGE_EXECUTABLES "@PROJECT_EXECUTABLES@")
    set(CPACK_PACKAGE_NAME ${CPACK_PACKAGE_FILE_NAME})
    set(CPACK_UNINSTALL_NAME @PROJECT_NAME@)
    set(CPACK_PACKAGE_INSTALL_DIRECTORY "@OPENRTM_SHARE_PREFIX@")

    # Windows WiX package settings
    if(${CPACK_GENERATOR} MATCHES "WIX")
      set(CPACK_WIX_CULTURES "ja-jp")
      set(CPACK_WIX_UPGRADE_GUID @UPGRADE_GUID@)
      set(CPACK_WIX_PRODUCT_ICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.ico")
      set(CPACK_WIX_UI_BANNER "@PROJECT_SOURCE_DIR@/cmake/rt_middleware_banner.bmp")
      set(CPACK_WIX_UI_DIALOG "@PROJECT_SOURCE_DIR@/cmake/rt_middleware_dlg.bmp")
      set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "http://www.openrtm.org")    
    endif()

ELSE(WIN32)
 set(CPACK_GENERATOR @LINUX_PACKAGE_GENERATOR@)
 set(CPACK_PACKAGE_CONTACT @PROJECT_MAINTAINER@)
ENDIF (WIN32)
